package utils;



public enum InteractionRelationship {
	
	PARENT(2),
	CHILD(3),
	SIBLING(1),
	SOLITARY(4);

    public static InteractionRelationship fromString(String string) {
        for(InteractionRelationship r : InteractionRelationship.values()){
            if(r.name().equalsIgnoreCase(string)){
                return r;
            }
        }
        return null;
    }

    private final int heirarchy;

    private InteractionRelationship(int h){
        this.heirarchy = h;
    }

    public static int heirarchyResult(InteractionRelationship a, InteractionRelationship b){
        if(a.heirarchy < b.heirarchy){
            return -1;
        } else if(a.heirarchy > b.heirarchy){
            return 1;
        }
        return 0;
    }


}
